import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCrmCardHolderController } from '../../../controllers';
const uctoocrmCardHolderRouter = new Router();
const crmCardHolderController = new uctooCrmCardHolderController();

uctoocrmCardHolderRouter.post('/add', requireUser, crmCardHolderController.add);
uctoocrmCardHolderRouter.post('/edit', requireUser, rowLevelPermission('uctoo/crm_card_holder'), crmCardHolderController.edit);
uctoocrmCardHolderRouter.post('/del', requireUser, rowLevelPermission('uctoo/crm_card_holder'), crmCardHolderController.delete);

//For getting crmCardHolder with permission control
uctoocrmCardHolderRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/crm_card_holder'), crmCardHolderController.getSingle);
uctoocrmCardHolderRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/crm_card_holder'), crmCardHolderController.getMany);
uctoocrmCardHolderRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/crm_card_holder'), crmCardHolderController.getMany);

//#endregion AutoCreateCode
export default uctoocrmCardHolderRouter;
